import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

export const useConfigStore = defineStore('config', () => {
  const width = ref(document.body.clientWidth)

  function refreshWidth() {
    width.value = document.body.clientWidth
  }

  function setWidth(w) {
    width.value = w
  }

  function getWidth() {
    return width.value
  }

  return { width, setWidth, getWidth, refreshWidth }
})
